@use './variables' as *;

// 通用组件样式
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: $spacing-lg;
  min-height: calc(100vh - 200px);
}

.content-section {
  background: $background-color;
  border-radius: $border-radius-lg;
  padding: $spacing-lg;
  box-shadow: $box-shadow-card;
  margin-bottom: $spacing-lg;
}

// 卡片组件
.card-container {
  background: $background-color;
  border-radius: $border-radius-lg;
  box-shadow: $box-shadow-card;
  transition: $transition-base;
  overflow: hidden;
  
  &:hover {
    box-shadow: $box-shadow-hover;
    transform: translateY(-2px);
  }
}

.card-header {
  padding: $spacing-lg;
  border-bottom: 1px solid $border-color-light;
  background: $background-color-light;
}

.card-body {
  padding: $spacing-lg;
}

.card-footer {
  padding: $spacing-md $spacing-lg;
  border-top: 1px solid $border-color-light;
  background: $background-color-light;
}

// 按钮样式
.btn-primary {
  background: $primary-color;
  border-color: $primary-color;
  color: $background-color;
  border-radius: $border-radius-base;
  font-weight: $font-weight-medium;
  transition: $transition-base;
  
  &:hover {
    background: $primary-color-hover;
    border-color: $primary-color-hover;
    transform: translateY(-1px);
    box-shadow: $box-shadow-hover;
  }
  
  &:active {
    background: $primary-color-active;
    border-color: $primary-color-active;
  }
}

.btn-secondary {
  background: $background-color;
  border-color: $border-color;
  color: $text-color;
  border-radius: $border-radius-base;
  font-weight: $font-weight-medium;
  transition: $transition-base;
  
  &:hover {
    border-color: $primary-color;
    color: $primary-color;
    transform: translateY(-1px);
  }
}

// 标签样式
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: $spacing-sm;
  margin: $spacing-md 0;
}

.tag-item {
  padding: $spacing-xs $spacing-sm;
  background: $primary-color;
  color: $background-color;
  border-radius: $border-radius-xxl;
  font-size: $font-size-xs;
  font-weight: $font-weight-medium;
  border: none;
  transition: $transition-base;
  
  &:hover {
    background: $primary-color-hover;
    transform: scale(1.05);
  }
}

// 加载状态
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  flex-direction: column;
  gap: $spacing-md;
}

.loading-text {
  color: $text-color-secondary;
  font-size: $font-size-base;
}

// 空状态
.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: $spacing-xxl;
}

.empty-icon {
  font-size: 64px;
  color: $text-color-disabled;
  margin-bottom: $spacing-lg;
}

.empty-title {
  font-size: $font-size-lg;
  font-weight: $font-weight-semibold;
  color: $text-color;
  margin-bottom: $spacing-sm;
}

.empty-description {
  color: $text-color-secondary;
  font-size: $font-size-base;
  margin-bottom: $spacing-lg;
  max-width: 400px;
}

// 错误状态
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: $spacing-xxl;
}

.error-icon {
  font-size: 64px;
  color: $error-color;
  margin-bottom: $spacing-lg;
}

.error-title {
  font-size: $font-size-lg;
  font-weight: $font-weight-semibold;
  color: $text-color;
  margin-bottom: $spacing-sm;
}

.error-description {
  color: $text-color-secondary;
  font-size: $font-size-base;
  margin-bottom: $spacing-lg;
  max-width: 400px;
}

// 响应式网格
.grid-container {
  display: grid;
  gap: $spacing-lg;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-item {
  background: $background-color;
  border-radius: $border-radius-lg;
  padding: $spacing-lg;
  box-shadow: $box-shadow-card;
  transition: $transition-base;
  
  &:hover {
    box-shadow: $box-shadow-hover;
    transform: translateY(-2px);
  }
}

// 列表样式
.list-container {
  background: $background-color;
  border-radius: $border-radius-lg;
  overflow: hidden;
  box-shadow: $box-shadow-card;
}

.list-item {
  padding: $spacing-lg;
  border-bottom: 1px solid $border-color-light;
  transition: $transition-base;
  
  &:last-child {
    border-bottom: none;
  }
  
  &:hover {
    background: $background-color-light;
  }
}

// 表单样式
.form-container {
  background: $background-color;
  border-radius: $border-radius-lg;
  padding: $spacing-lg;
  box-shadow: $box-shadow-card;
}

.form-group {
  margin-bottom: $spacing-lg;
}

.form-label {
  display: block;
  margin-bottom: $spacing-sm;
  font-weight: $font-weight-medium;
  color: $text-color;
}

.form-input {
  width: 100%;
  padding: $spacing-sm $spacing-md;
  border: 1px solid $border-color;
  border-radius: $border-radius-base;
  font-size: $font-size-base;
  transition: $transition-base;
  
  &:focus {
    outline: none;
    border-color: $primary-color;
    box-shadow: $box-shadow-focus;
  }
  
  &:hover {
    border-color: $primary-color-hover;
  }
}

// 工具类
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: $spacing-sm; }
.mb-md { margin-bottom: $spacing-md; }
.mb-lg { margin-bottom: $spacing-lg; }
.mb-xl { margin-bottom: $spacing-xl; }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: $spacing-sm; }
.mt-md { margin-top: $spacing-md; }
.mt-lg { margin-top: $spacing-lg; }
.mt-xl { margin-top: $spacing-xl; }

.p-0 { padding: 0; }
.p-sm { padding: $spacing-sm; }
.p-md { padding: $spacing-md; }
.p-lg { padding: $spacing-lg; }
.p-xl { padding: $spacing-xl; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: $border-radius-base; }
.rounded-lg { border-radius: $border-radius-lg; }
.rounded-xl { border-radius: $border-radius-xl; }

.shadow { box-shadow: $box-shadow-base; }
.shadow-lg { box-shadow: $box-shadow-hover; }

// 响应式工具类
@media (max-width: $breakpoint-md) {
  .md\:hidden { display: none; }
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:flex-column { flex-direction: column; }
  .md\:text-center { text-align: center; }
}

@media (max-width: $breakpoint-sm) {
  .sm\:hidden { display: none; }
  .sm\:block { display: block; }
  .sm\:flex { display: flex; }
  .sm\:flex-column { flex-direction: column; }
  .sm\:text-center { text-align: center; }
}
